package com.niiwoo.civet.trade.dto.response.myloan;

import com.niiwoo.civet.trade.dto.response.myloan.inner.BackToArticleDetails;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by bincun on 2017/11/23.
 * 回款计划-按日查看
 */
@Getter
@Setter
public class BackToArticleByDayResponseDTO implements Serializable {
    
    
    // 应收款年月
    private String yearMouth;
    
    //一月总金额
    private BigDecimal januaryTotalAmount = BigDecimal.ZERO;

    //三月总金额
    private BigDecimal marchTotalAmount = BigDecimal.ZERO;

    //半年总金额
    private BigDecimal halfYearTotalAmount = BigDecimal.ZERO;

    //全部总金额
    private BigDecimal allTotalAmount = BigDecimal.ZERO;

    //待收本息总额
    private BigDecimal dueInTotalAmount = BigDecimal.ZERO;

    //待收总笔数
    private Integer dueInTotalNumber = 0;

    //待收总本金
    private BigDecimal dueInTotalCapital = BigDecimal.ZERO;

    //待收总利息
    private BigDecimal dueInTotalInterest = BigDecimal.ZERO;

    //待收总奖励
    private BigDecimal dueInTotalReward = BigDecimal.ZERO;

    //近期回款总金额
    private BigDecimal recentReceivableTotal = BigDecimal.ZERO;

    //近期回款日
    private Date recentPaybackDate;

    //近期回款笔数
    private Integer recentReceivableNumber = 0;
    
    public String getYearMouth() {
        if(yearMouth != null){
            String temp = null;
			try {
				SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMM");
				SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年M月");
				temp = sdf2.format(sdf1.parse(yearMouth));
			} catch (ParseException e) {
				e.printStackTrace();
			}
            return temp;
        }else {
            return "";
        }
    }


    /**
     * 还款详情
     */
    private List<BackToArticleDetails> details;
    
}
